//
//  RootViewController.swift
//  SwiftCodeOc
//
//  Created by zhangjianyun on 17/6/30.
//  Copyright © 2017年 com.taihejiacheng. All rights reserved.
//

import UIKit

class RootViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        self.title = "首页"
        
        let imageView = XHImageView.init(frame: CGRect.init(x: 100, y: 100, width: 100, height: 100))
        imageView.image = UIImage.init(named: "icon")
        //给图片加点击事件
        imageView.addTarget(self, withSeletor: Selector(("imageClick:")))
        imageView.test()
        self.view.addSubview(imageView)
    }
    
    func imageClick(sender: XHImageView) {
        print("Click \(sender)")
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
